import request from '@/http/request'
import { contractResult } from "@/api/project";
const apiUrl = 'bf-investment'
const apiUserUrl = 'bf-user'

/**
 * 项目集相关接口
 * @type {{}}
 */
export const projectSetApi = {
  getProjectSetPage: (param) => request.post(`${apiUrl}/projectSet/getProjectSetPage`, param), // 获取项目集分页
  exportProjectSet: (param) => request.get(`${apiUrl}/projectSet/export`, { params: param, responseType: 'arraybuffer' }), // 项目集导出
  create: (param) => request.post(`${apiUrl}/projectSet/create`, param), // 创建项目集
  update: (param) => request.post(`${apiUrl}/projectSet/update`, param), // 更新项目集
  getProjectSet: (param) => request.get(`${apiUrl}/projectSet/getProjectSet?projectSetId=${param.projectSetId}`), // 编辑项目集获取的信息
  deleteProjectSet: (param) => request.get(`${apiUrl}/projectSet/remove?projectSetId=${param.projectSetId}`), // 删除项目集
  getPage: (param) => request.post(`${apiUrl}/projectSummary/getPage`, param), // 分页查询可总结项目列表
  getInfo: (projectId) => request.get(`${apiUrl}/projectSummary/getInfo?projectId=${projectId}`), // 查询项目总结详情
}

/**
 * 预备投资项目库相关接口
 * @type {{}}
 */
export const reserveInvestmentProjectLibraryApi = {
  getPage: (param) => request.post(`${apiUrl}/projectInvestment/getPage`, param), // 查询列表
  addOne: (param) => request.post(`${apiUrl}/projectInvestment/addOne`, param), // 新增
  upload: (param) => request.post(`${apiUrl}/projectInvestment/upload`, param), // 上传
  getAllPartner: () => request.get(`${apiUrl}/partner/getAll`), // 合作方
  submitForApproval: (param) => request.post(`${apiUrl}/projectInvestment/submitForApproval`, param), // 提交审批
  submitForApproval2: (param) => request.post(`${apiUrl}/projectInvestmentPlan/submitForApproval`, param), // 提交审批
  getProjectInfo: (param) => request.get(`${apiUrl}/projectInvestment/geInfo`, { params: param }), // 查询项目详情
  getInvestmentPlanVo: (param) => request.get(`${apiUrl}/projectInvestment/getInvestmentPlanVo`, { params: param }), // 查询方案数据
  deleteList: (param) => request.post(`${apiUrl}/projectInvestment/deleteList`, param), // 删除
  getPlanWord: (param) => request.post(`${apiUrl}/projectInvestment/cache/getplanWord`, param, { responseType: 'arraybuffer' }), // 根据项目名称获取渲染后的word  responseType: 'blob'
  getBaseInfo: (projectId) => request.get(`${apiUrl}/projectInvestment/getBaseInfo?projectId=${projectId}`), // 获取基础信息
  getStage: (projectId, projectTypeId) => request.get(`${apiUrl}/stage/getStage?projectId=${projectId}&projectTypeId=${projectTypeId}`), // 获取项目实施阶段配置
  getInvestmentPlanPage: (param) => request.post(`${apiUrl}/projectInvestment/getInvestmentPlanPage`, param), // 投资项目方案列表
  getInvestmentApprovalPage: (param) => request.post(`${apiUrl}/projectInvestment/getInvestmentApprovalPage`, param), // 投资项目立项列表
  getInvestmentApprovalPage2: (param) => request.get(`${apiUrl}/projectInvestment/getInvestmentApproval`, { params: param }), // 投资项目立项
  saveProjectApproval: (param) => request.post(`${apiUrl}/projectInvestment/saveProjectApproval`, param), // 送审立项审批单
  saveProjectMeeting: (param) => request.post(`${apiUrl}/projectInvestment/saveProjectMeeting`, param), // 送审项目议题
  getProjectMeeting: (projectId) => request.get(`${apiUrl}/projectInvestment/getProjectMeeting?projectId=${projectId}`), // 查看项目议题
  getProjectApproval: (projectId) => request.get(`${apiUrl}/projectInvestment/getProjectApproval?projectId=${projectId}`), // 查看项目议题
  natureChange: (param) => request.get(`${apiUrl}/projectInvestment/natureChange`, { params: param }), // 项目变更

}

/**
 * 投资项目
 * @type {{}}
 */
export const investmentProjects = {
  getProjectAllTaskList: (param) => request.post(`${apiUrl}/task/getProjectAllTaskList`, param), // 项目实施任务列表(管理端)
  updateTask: (param) => request.post(`${apiUrl}/task/updateTask`, param), // 更新任务、分配责任人
  getAllotUsers: (projectTaskId) => request.get(`${apiUrl}/task/getAllotUsers?projectTaskId=${projectTaskId}`), // 通过项目任务编号获取可以分配的用户列表
  getBoard: (projectId) => request.get(`${apiUrl}/task/board?projectId=${projectId}`), // 获取统计信息
  getDeptUserList: (params) => request.get(`${apiUrl}/task/getDeptUserList?isHide=${params.isHide}&projectId=${params.projectId}`), // 获取统计部门用户列表
  getTaskNodeList: (taskId) => request.get(`${apiUrl}/taskItem/taskNodeList?taskId=${taskId}`), // 节点列表
  getActionList: (actionType = 1) => request.get(`${apiUrl}/commonAction/actionList?actionType=${actionType}`), // 行为列表
  operateTaskNode: (param) => request.post(`${apiUrl}/taskItem/operateTaskNode`, param), // 节点配置统一操作
  addProjectInvestmentInfo: (param) => request.post(`${apiUrl}/projectInvestmentInfo/addAndUp`, param), // 新增
  getProjectApproval: (projectId) => request.get(`${apiUrl}/projectInvestment/getProjectApproval?projectId=${projectId}`), // 查看立项审批单
  getPlanDetail: (projectId) => request.get(`${apiUrl}/projectInvestmentInfo/getPlanDetail?projectId=${projectId}`), // 获取项目投资计划
  getProjectTime: (projectId) => request.get(`${apiUrl}/projectInvestmentInfo/getProjectTime?projectId=${projectId}`), // 获取项目时间轴
  getProjectTaskList: (param) => request.post(`${apiUrl}/task/getProjectTaskList`, param), // 项目实施任务列表
  getTaskNum: (projectId) => request.get(`${apiUrl}/task/getTaskNum?projectId=${projectId}`), // 任务完成情况
  getProjectInvestmentInfoHistory: (projectId) => request.get(`${apiUrl}/projectInvestmentInfo/history?projectId=${projectId}`), // 立项变更历史日志
  updateApproval: (param) => request.post(`${apiUrl}/projectInvestment/updateApproval`, param), // 立项变更
  updateApproval2: (param) => request.post(`${apiUrl}/projectInvestment/operationChange`, param), // 立项变更申请
  getRevenuePage: (projectId) => request.get(`${apiUrl}/projectInvestmentRevenue/getRevenuePage?projectId=${projectId}`), // 获取项目现金流表
  getYear: (projectId) => request.get(`${apiUrl}/projectInvestmentRevenue/getYear?projectId=${projectId}`), // 获取动态年份
  addCategory: (param) => request.post(`${apiUrl}/projectInvestmentRevenue/addCategory`, param), // 新增盈收分类
  editCategory: (param) => request.post(`${apiUrl}/projectInvestmentRevenue/edit`, param), // 编辑类别
  deleteCategory: (categoryId) => request.get(`${apiUrl}/projectInvestmentRevenue/del?categoryId=${categoryId}`), // 删除类别
  editAndAddCashFlow: (param) => request.post(`${apiUrl}/projectInvestmentRevenue/revenue`, param), // 新增/编辑现金流量
  editAndAddCashFlowOne: (param) => request.post(`${apiUrl}/projectInvestmentRevenue/revenue/one`, param), // 新增/编辑现金流量
  getCategory: (param) => request.get(`${apiUrl}/projectInvestmentRevenue/getCategory`, { params: param }), // 获取盈收分类
  exportCategory: (param) => request.get(`${apiUrl}/projectInvestmentRevenue/export`, { params: param, responseType: 'arraybuffer' }), // 导出
  delProjectInvestmentRevenue: (param) => request.post(`${apiUrl}/projectInvestmentRevenue/revenue/del`, param), // 删除现金流量
  importExcel: (param, projectId) => request.post(`${apiUrl}/projectInvestmentRevenue/import?projectId=${projectId}`, param), // 现金流量表导入
  getInfo: (param) => request.get(`${apiUrl}/projectInvestment/getInfo`, { params: param }), // 查询项目详情
}

/**
 * 成本测算相关接口
 * @type {{}}
 */
export const costEstimationApi = {
  editProjectInvestmentCost: (param) => request.post(`${apiUrl}/projectInvestmentCost/edit`, param), // 编辑类别
  addProjectInvestmentCost: (param) => request.post(`${apiUrl}/projectInvestmentCost/cost`, param), // 新增/编辑成本
  addProjectInvestmentCostOne: (param) => request.post(`${apiUrl}/projectInvestmentCost/cost/one`, param), // 新增/编辑成本
  addCategory: (param) => request.post(`${apiUrl}/projectInvestmentCost/addCategory`, param), // 新增成本分类
  getYear: (projectId) => request.get(`${apiUrl}/projectInvestmentCost/getYear?projectId=${projectId}`), // 获取动态年份
  getCost: (projectId) => request.get(`${apiUrl}/projectInvestmentCost/getCost?projectId=${projectId}`), // 获取项目成本测算表
  getCategory: (param) => request.get(`${apiUrl}/projectInvestmentCost/getCategory`, { params: param }), // 获取成本分类
  exportCost: (param) => request.get(`${apiUrl}/projectInvestmentCost/export`, { params: param, responseType: 'arraybuffer' }), // 导出
  delCost: (categoryId) => request.get(`${apiUrl}/projectInvestmentCost/del?categoryId=${categoryId}`), // 删除类别
  delProjectInvestmentCost: (param) => request.post(`${apiUrl}/projectInvestmentCost/cost/del`, param), // 删除成本
  importExcel: (param, projectId) => request.post(`${apiUrl}/projectInvestmentCost/import?projectId=${projectId}`, param), // 成本测试导入
  mb: (param) => request.get(`${apiUrl}/project/file/download/mb`, { params: param, responseType: 'arraybuffer' }), // 模版下载
}

/**
 * 投资日常相关接口
 * @type {{}}
 */
export const investmentDailyApi = {
  getDailyList: (param) => request.post(`${apiUrl}/projectInvestmentDaily/getDailyList`, param), // 获取投资日常列表
  getIssueList: (param) => request.post(`${apiUrl}/projectInvestmentDaily/getIssueList`, param), // 重大事项列表
  getReportMeetingList: (param) => request.post(`${apiUrl}/projectInvestmentDaily/getReportMeetingList`, param), // 经营财报会议申请列表
  addIssue: (param) => request.post(`${apiUrl}/projectInvestmentDaily/addIssue`, param), // 资料填报-重大事项
  investMeeting: (param) => request.post(`${apiUrl}/projectInvestmentDaily/investMeeting`, param), // 资料填报-重大事项
  addResult: (param) => request.post(`${apiUrl}/projectInvestmentDaily/result`, param), // 上传会议结果
  getProjectInvestmentDaily: (meetingId) => request.get(`${apiUrl}/projectInvestmentDaily/view?meetingId=${meetingId}`), // 会议记录信息查看
  turnBack: (param) => request.get(`${apiUrl}/projectInvestment/turnBack`, { params: param }), // 转为投后
}

/**
 * 会议管理相关接口
 * @type {{}}
 */
export const meetingsManagementApi = {
  addMeetings: (param) => request.post(`${apiUrl}/projectMeeting/add`, param), // 项目相关会议信息新增
  pageMeetings: (param) => request.post(`${apiUrl}/projectMeeting/manage/page`, param), // 会议管理分页查询
  upResult: (param) => request.post(`${apiUrl}/projectMeeting/upResult`, param), // 项目相关会议信息修改
  viewMeetings: (meetingId) => request.get(`${apiUrl}/projectMeeting/manage/view?meetingId=${meetingId}`), // 会议管理查看
  exportMeetings: (param) => request.get(`${apiUrl}/projectMeeting/export`, { params: param, responseType: 'arraybuffer' }), // 导出会议
  getProjectInvestmentDaily: (param) => request.post(`${apiUrl}/projectInvestmentDaily/page`, param), // 投资会议记录信息分页查询


}

/**
 * 方案管理相关接口
 * @type {{}}
 */
export const programmeManagementApi = {
  getPage: (param) => request.post(`${apiUrl}/projectInvestmentPlan/getPage`, param), // 查询列表
  getProgramme: (param) => request.get(`${apiUrl}/projectInvestmentPlan/view`, { params: param }), //预览方案
  editForApproval: (param) => request.post(`${apiUrl}/projectInvestmentPlan/editForApproval`, param), //修改方案审批
  submitReference: (param) => request.post(`${apiUrl}/projectInvestmentPlan/Reference`, param), //备案
}

/**
 * 其他相关接口
 * @type {{}}
 */
export const otherApi = {
  getListEnum: (param) => request.get(`${apiUrl}/enum/getList`, { params: param }), // 查询下拉框
  getCompanyList: (param) => request.post(`${apiUrl}/projectInvestment/company/getlist`, param), // 获取公司列表



}
/**
 * 控制台
 * @type {{}}
 */
export const consoleApi = {

  getUserJoinProject: (param) => request.get(`${apiUrl}/control/getUserJoinProject`), // 我参与项目
  getUserProjectAnalyze: (param) => request.post(`${apiUrl}/control/getUserProjectAnalyze`, param), // 进度
  getUserTask: (param) => request.get(`${apiUrl}/control/getUserTask`,), // 任务数量情况
  meetingPage: (param) => request.post(`${apiUrl}/control/meeting/page`, param), // 任务数量情况
  // getList: (param) => request.post(`${apiUrl}/projectInvestment/getList`, param), // 项目分类

  getManageView: (param) => request.get(`${apiUrl}/projectMeeting/manage/view?meetingId=${param}`,), // 会议查看
  export: (param) => request.get(`${apiUrl}/control/export`, { params: param, responseType: 'arraybuffer' }), // 导出
  getProjectMsgPage: (param) => request.post(`/bf-user/msg/project/getProjectMsgPage`, param), // 任务数量情况

  projectInvestment: (param) => request.post(`${apiUrl}/projectInvestment/getList`, param), // 下拉
}


/**
 * 通知相关接口
 * @type {{}}
 */
export const notificationApi = {
  getProjectTypePage: (param) =>
    request.post(`${apiUrl}/public/type/getProjectTypePage`, param), // 获取项目实施阶段配置
  publicTypeUpdate: (param) =>
    request.post(`${apiUrl}/public/type/update`, param), // 更新项目类型

  publicTypeCreate: (param) =>
    request.post(`${apiUrl}/public/type/create`, param), // 获取项目实施阶段配置


  getByIdProjectType: (param) =>
    request.get(`${apiUrl}/public/type/getProjectType?projectTypeId=` + param), // 编辑时获取项目类型信息

  getProjectTypeVo: (param) =>
    request.get(`${apiUrl}/public/type/getProjectTypeVo`), // 获取项目类型用于下拉框

  typeRemove: (param) =>
    request.get(`${apiUrl}/public/type/remove?projectTypeId=` + param), // 编辑时获取项目类型信息
  getStage: (param) =>
    request.get(`${apiUrl}/public/stage/getStage?projectTypeId=` + param), // 编辑时获取项目类型信息
  stageCreate: (param) => request.post(`${apiUrl}/public/stage/create`, param), // 新增配置
  stageUpdate: (param) => request.post(`${apiUrl}/public/stage/update`, param), // gengx配置
  stageRemove: (param) =>
    request.get(`${apiUrl}/public/stage/remove?stageId=` + param), // shanchu配置


  saveConfig: (param) => request.post(`${apiUrl}/system/saveConfig`, param), // 批量更新或新增任务通知
  deleteById: (param) => request.post(`${apiUrl}/system/deleteById`, param), // 删除通知
  getConfig: (param) => request.get(`${apiUrl}/system/getConfig?configType=` + param), // 获取任务通知配置
}

// -----------部门&人员信息----------
export const department = {
  getProjectPhase: (param) =>
    request.get(`${apiUserUrl}/department/getDepartmentTree`), // 项目阶段
  getAllDepartments: (param) =>
    request.get(`${apiUserUrl}/department/getAllDepartments`), // 获取部门
  getUserByDepartmentId: (param) =>
    request.get(
      `${apiUserUrl}/user/getUserByDepartmentId?departmentId=${param}`
    ), // 根据部门获取人员
  getLeaderByDepartmentId: (param) =>
    request.get(
      `${apiUserUrl}/user/getLeaderByDepartmentId?departmentId=${param}`
    ), // 根据部门获取人员
  savePeople: (param) => request.post(`${apiUrl}/stage/worker/create`, param), // 新增
  getUserList: (param) => request.get(`${apiUrl}/projectInvestmentDaily/user/list`, { params: param }) // 人员列表

}

/**
 * 合作方管理
 * @type {{}}
 */
export const cooperationApi = {
  getAll: (param) => request.get(`${apiUrl}/partner/getAll`, param), // 合作方下拉框
  getPage: (param) => request.post(`${apiUrl}/partner/getPage`, param), // 合作方page
  partnerDelete: (param) => request.post(`${apiUrl}/partner/del`, param), // 删除
  partnerAddAndUp: (param) => request.post(`${apiUrl}/partner/addAndUp`, param), // 新增、编辑合作方信息
  // partnerAddAndUp: (param) => request.post(`${apiUrl}/partner/addAndUp`, param), // 新增、编辑合作方信息


}

/**
 * 资金管理
 * @type {{}}
 */
export const managementApi = {
  getManagementView: (param) => request.post(`${apiUrl}/fund/management/view`, param), // 项目资金管理分页列表
  getManagementPlanPage: (param) => request.post(`${apiUrl}/fund/management/page/plan`, param), // 项目资金预算管理分页列表
  getManagementPage: (param) => request.post(`${apiUrl}/fund/management/page`, param), // 项目资金预算管理分页列表
  getBudgetSubjectList: (param) => request.get(`${apiUrl}/fund/management/subject/getBudgetSubjectList?subjectId=${param.subjectId || ''}&subjectType=${param.subjectType || ''}`), // 款项结算记录分页列表


}
/**
 * 工具管理
 * @type {{}}
 */
export const toolApi = {
  getToolCatPag: (param) => request.post(`${apiUrl}/tool/catPage`, param), // 工具库分类分页查询
  createAndUpdate: (param) => request.post(`${apiUrl}/tool/createAndUpdate`, param), // 新增、编辑工具库分类
  delBatch: (param) => request.post(`${apiUrl}/tool/delBatch`, param), // 删除
  upload: (param) => request.post(`${apiUrl}/tool/upload`, param), // 文件上传

  getToolList: (param) => request.post(`${apiUrl}/tool/list`, param), // 文件列表
  getCatList: (param) => request.get(`${apiUrl}/tool/catList`), // 工具库分类列表
  getCogList: (param) => request.get(`${apiUrl}/tool/log/list`), // 文件操作日志
  toolDownload: (param) => request.get(`${apiUrl}/tool/download?urlKey=${param.urlKey}&catId=${param.catId}`, { responseType: "blob" }), // 文件下载
  toolDelete: (param) => request.get(`${apiUrl}/tool/delete?urlKey=${param.urlKey}&catId=${param.catId}`,), // 文件删除
  toolDelete2: (param) => request.get(`${apiUrl}/project/file/delFile?fileUrlKey=${param.urlKey}`,), // 文件删除
}

/**
 * 文件相关接口
 * @type {{}}
 */
export const fileApi = {
  upload: (param) => request.post(`${apiUrl}/file/upload`, param), // 文件上传
  uploadOfNew: (data) => {
    return request.post(`${apiUrl}/file/upload`, data)
  }, // 文件上传
  download: (urlKey) => request.get(`${apiUrl}/file/download?urlKey=${urlKey}`, { responseType: 'arraybuffer' }), // 文件下载
  deleteFile: (urlKey) => request.get(`${apiUrl}/file/delete?urlKey=${urlKey}`), // 删除文件
  getMinioAddress: (param) => request.get(`bf-investment/project/file/getMinioAddress`, { params: param }), // 获取minio上传地址
}

/**
 * 项目资料管理
 * @type {{}}
 */
export const projectFileApi = {
  getProjectPageList: (param) => request.post(`${apiUrl}/project/file/getProjectPageList`, param), // 获取项目分页列表
  getFilePageList: (param) => request.post(`${apiUrl}/project/file/getFilePageList`, param), // 获取项目分页列表
  getDownloadLogList: (param) => request.get(`${apiUrl}/project/file/getDownloadLogList`, { params: param }), // 文件下载记录
  projectExport: (param) => request.get(`${apiUrl}/project/file/export?keyword=${param}`, { responseType: "blob" }), // 项目导出
  download: (param) => request.get(`${apiUrl}/project/file/download?urlKey=${param.urlKey}&stageId=${param.stageId}`, { responseType: 'arraybuffer' }), // 下载
  uploadFile: (param) => request.post(`${apiUrl}/project/file/upload/stage`, param), // 上传项目资料
  record: (param) => request.get(`${apiUrl}/project/file/upload/stage/record`, { params: param }), // 保存跟阶段关联
}
/**
 * 年度计划
 * @type {{}}
 */
export const annualApi = {
  getManagePage: (param) => request.post(`${apiUrl}/annual/managePage`, param), // 年度计划管理分页列表
  planStatus: (projectId, type) => request.get(`${apiUrl}/annual/planStatus?projectId=${projectId}&status=${type}`,), // 转为计划内
  getManageDetail: (param) => request.post(`${apiUrl}/annual/manageDetail`, param), // 详情
  getTotal: (param) => request.post(`${apiUrl}/annual/total`, param), // 顶部金额
  export: (param) => request.get(`${apiUrl}/annual/export?projectTypeId=${param.projectTypeId}&year=${param.year}&keyword=${param.keyword}`, { responseType: "blob" }), // 导出
  exportG: (param) => request.get(`${apiUrl}/annual/exportG`, { params: param, responseType: "blob" }), // 股投 导出
  exportGu: (param) => request.get(`${apiUrl}/annual/exportGu`, { params: param, responseType: "blob" }), // 固投 导出
}

/**
 * 合同相关接口
  *
 */
export const contractManagementApi = {
  getContractPage: (param) => request.post(`${apiUrl}/contract/getContractPage`, param), // 分页获取合同信息
  getContractAndFundPlanDetail: (contractId) => request.get(`${apiUrl}/contract/getContractAndFundPlanDetail?contractId=${contractId}`), // 查询合同款项信息详情
  createContract: (param) => request.post(`${apiUrl}/contract/create`, param), // 新增合同款项信息


}

/**
 * 驾驶舱相关接口
 *
 */
export const cockpitApi = {
  getPlanExecuteSns: (param) => request.post(`${apiUrl}/system/cockpit/getPlanExecuteSns`, param), // 预算执行情况[中3]
  getYearPlan: (param) => request.get(`${apiUrl}/system/cockpit/getYearPlan`, { params: param }), // 年度项目计划[左3]
  getTaskExceedTopCount: (param) => request.get(`${apiUrl}/system/cockpit/getTaskExceedTopCount`, { params: param }), // 项目任务年度逾期情况Top 5[右2]
  getProjectTypeSns: (param) => request.get(`${apiUrl}/system/cockpit/getProjectTypeSns`, { params: param }), // 总投资项目总数[中2]
  getProjectProfit: (param) => request.get(`${apiUrl}/system/cockpit/getProjectProfit`, { params: param }), // 投资收益快报Top 5[右1]
  getInvestDeviationTop10: (param) => request.get(`${apiUrl}/system/cockpit/getInvestDeviationTop10`, { params: param }), // 固投偏差Top10[左2]
  getFundSns: (param) => request.get(`${apiUrl}/system/cockpit/getFundSns`, { params: param }), // 项目资金情况分析[左1]
  getAllProjectCount: (param) => request.get(`${apiUrl}/system/cockpit/getAllProjectCount`, { params: param }), // 项目总况[中1]
  getWeeklyDepartmentUnWriteCount: (param) => request.get(`${apiUrl}/system/cockpit/getWeeklyDepartmentUnWriteCount`, { params: param }), // 周报未填写Top 5
}

/**
 * 任务相关接口
 * @type {{}}
 */
export const taskApi = {
  getImplementationAchievements: (param) => request.get(`${apiUrl}/task/item/action/report/info`, { params: param }), // 实施成果详情
  saveImplementationAchievements: (param) => request.post(`${apiUrl}/task/item/action/report/save`, param), // 保存实施成果
  getProjectProblemApproval: (param) => request.get(`${apiUrl}/system/bfProjectProblemApproval/view`, { params: param }), // 招标议题审批查看
  addProjectProblemApproval: (param) => request.post(`${apiUrl}/system/bfProjectProblemApproval/add`, param), // 招标议题审批查看
  getProjectBusinessRequest: (param) => request.get(`${apiUrl}/system/bfProjectBusinessRequest/view`, { params: param }), // 获取业务请示获取详情信息
  addProjectBusinessRequest: (param) => request.post(`${apiUrl}/system/bfProjectBusinessRequest/add`, param), // 业务请示新增
  getDecisionMakingMeetings: (param) => request.get(`${apiUrl}/task/item/action/decision/info`, { params: param }), // 决策会议详情
  addDecisionMakingMeetings: (param) => request.post(`${apiUrl}/task/item/action/decision/save`, param), // 决策会议上传
  getServiceUnit: (param) => request.get(`${apiUrl}/system/bfTenderTaskReference/view`, { params: param }), // 推荐服务单位审批单查看
  addServiceUnit: (param) => request.post(`${apiUrl}/system/bfTenderTaskReference/add`, param), // 推荐服务单位审批单新增
  getContractDraft: (param) => request.get(`${apiUrl}/contract/view`, { params: param }), // 合同初稿查看
  addContractDraft: (param) => request.post(`${apiUrl}/contract/add`, param), // 合同初稿新增
  getContractInfo: (param) => request.get(`${apiUrl}/task/item/action/annex/info`, { params: param }), // 合同扫描件详情
  saveContractInfo: (param) => request.post(`${apiUrl}/task/item/action/annex/save`, param), // 合同扫描件保存
  getLateReporting: (param) => request.get(`${apiUrl}/taskItem/audit/info`, { params: param }), // 逾期上报详情
  saveLateReporting: (param) => request.post(`${apiUrl}/taskItem/audit/save`, param), // 逾期上报保存
  saveLateReportingReview: (param) => request.post(`${apiUrl}/taskItem/audit/update`, param), // 逾期上报审核
}

/**
 * 周报相关接口
 * @type {{}}
 */
export const weeklyApi = {
  getWeeklyPage: (param) => request.post(`bf-user/weekly/company/getWeeklyPage`, param), // 分页获取公司周报
  createWeekly: (param) => request.post(`bf-user/weekly/company/createWeekly`, param), // 新增公司周报
  updateWeeklyStatus: (param) => request.get(`bf-user/weekly/company/updateWeeklyStatus`, { params: param }), // 下发公司周报
  getWeeklyWrite: (param) => request.get(`bf-user/weekly/company/getWeeklyWrite`, { params: param }), // 获取公司周报填写记录
  createWeeklyWrite: (param) => request.post(`bf-user/weekly/company/createWeeklyWrite`, param), // 新增公司周报填写记录
  getAllDepartments: () => request.get(`bf-user/department/getAllDepartments`,),// 获取所有部门
  updateWeeklyWrite: (param) => request.post(`bf-user/weekly/company/updateWeeklyWrite`, param),// 更新公司周报填写记录
  createWeekly_department: (param) => request.post(`bf-user/weekly/department/createWeekly`, param), // 新增部门周报
  companyWeeklyExport: (param) => request.get(`bf-user/weekly/company/export`, { params: param, responseType: 'blob' }), // 公司周报 导出
  companyWeeklyInfoExport: (param) => request.get(`bf-user/weekly/company/write/export`, { params: param, responseType: 'blob' }), // 公司周报详情 导出

}

/**
 * 项目总结
 * @type {{}}
 */
export const summaryApi = {
  addOne: (param) => request.post(`bf-investment/projectSummary/addOne`, param),// 保存
  updateOne: (param) => request.post(`bf-investment/projectSummary/updateOne`, param),// 修改
}

/**
* 项目总投资
*/
export const projectInvestApi = {
  getList: (param) => request.post(`${apiUrl}/annual/getProjectBudgetTotalInvestment`, param),
  fileExport: (param) => request.get(`${apiUrl}/annual/getBudgetTotalInvestmentLeadingOut?projectId=${param.projectId}&year=${param.year}`, { responseType: "blob" })
};

/**
 *  投资新接口 20230907
 */
export const newInvestApi = {
  getInvestBudgetFile: (param) => request.get(`${apiUrl}/projectInvestmentDaily/getInvestBudgetFile`, { params:param }), // 投资预算附件
  uploadBudget: (param) => request.post(`${apiUrl}/projectInvestmentDaily/upload/budget`, param), // 上传经营预算附件
  delInvestBudgetFile: (param) => request.post(`${apiUrl}/projectInvestmentDaily/delInvestBudgetFile`, param), // 删除投资预算附件
  addBusiness: (param) => request.post(`${apiUrl}/projectInvestmentDaily/addBusiness`, param), // 新增/编辑经营情况
  getBusinessCondition: (param) => request.post(`${apiUrl}/projectInvestmentDaily/businessCondition`, param), // 经营情况列表
  delBusiness: (param) => request.post(`${apiUrl}/projectInvestmentDaily/delBusiness`, param), // 删除经营情况列表
  exportBusinessCondition: (param) => request.post(`${apiUrl}/projectInvestmentDaily/export`, param, { responseType: "blob" }), // 经营情况 导出
}

/**
* 年度计划-投资计划汇总表
*/
export const investSummaryApi = {
  getSummaryPage: (param) => request.post(`${apiUrl}/annual/planSummaryPage`, param),
  editList: (param) => request.post(`${apiUrl}/annual/addPlanSummary`, param),
  deleteList: (param) => request.post(`${apiUrl}/annual/delPlanSummary`, param),
  exportFIle: (param) => request.post(`${apiUrl}/annual/getBudgetTotalInvestmentLeadingOut`, param, { responseType: "blob" }),
};

export default {
  projectSetApi,
  reserveInvestmentProjectLibraryApi,
  programmeManagementApi,
  otherApi,
  consoleApi,
  investmentProjects,
  notificationApi,
  department,
  cooperationApi,
  toolApi,
  costEstimationApi,
  investmentDailyApi,
  fileApi,
  meetingsManagementApi,
  projectFileApi,
  annualApi,
  contractManagementApi,
  cockpitApi,
  taskApi,
  weeklyApi,
  projectInvestApi
}
